# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=stews
pkgver=1.0.0.r7.gc7bba5a
pkgrel=6
pkgdesc='A Security Tool for Enumerating WebSockets.'
groups=('blackarch' 'blackarch-webapp' 'blackarch-scanner'
        'blackarch-fingerprint' 'blackarch-fuzzer')
arch=('any')
url='https://github.com/PalindromeLabs/STEWS'
license=('Apache')
depends=('python' 'python-cprint' 'python-requests' 'python-websocket-client'
         'bash' 'zgrab')
makedepends=('git')
source=("$pkgname::git+https://github.com/PalindromeLabs/STEWS.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}

package() {
  cd $pkgname

  install -dm 755 "$pkgdir/usr/bin"
  install -dm 755 "$pkgdir/usr/share/$pkgname"

  install -m 755 discovery/STEWS-discovery.sh "$pkgdir/usr/bin/stews-discovery"
  install -m 755 fingerprint/STEWS-fingerprint.py \
    "$pkgdir/usr/bin/stews-fingerprint"
  install -m 755 vuln-detect/STEWS-vuln-detect.py \
    "$pkgdir/usr/bin/stews-vuln-detect"

  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md *.pdf
}

